<?php
/**
 * Byzantium Library
 *
 * @author David Mora <dla.mora@gmail.com>
 * @category   Byzantium
 * @package    Byzantium
 * @copyright  Creative Commons Attribution-Share Alike 3.0 United States License
 * 2009-2010 David Mora <dla.mora@gmail.com>
 * @license    http://creativecommons.org/licenses/by-sa/3.0/us/
 *
 */
class Byzantium_Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    /**
     * object constructor
     * @return null
     */
    public function __construct($application)
    {
        parent::__construct($application);
        $logger = $this->getPluginResource('log')->getLog();
        $logger->log(__METHOD__ . ' starting.', Zend_Log::INFO);
        Zend_Registry::set('log' , $logger);
    }

    /**
     * Inits the registry
     * @return null
     */
    protected function _initRegistry()
    {
        $logger = Byzantium_Application::getInstance()->getLogger();
        $logger->log(__METHOD__ . ' starting.', Zend_Log::INFO);

        $logger->log(__METHOD__ . ' registering App\'s options.', Zend_Log::INFO);
        $options = $this->getOptions();
        Zend_Registry::set('config' , $options);
        $logger->log(__METHOD__ . ' registering App\'s options done.', Zend_Log::INFO);

        $logger->log(__METHOD__ . ' done.', Zend_Log::INFO);
    }

    /**
     * object destructor
     * @return null
     */
    public function __destruct()
    {
        $logger = Byzantium_Application::getInstance()->getLogger();
        $logger->log(__METHOD__ . ' done', Zend_Log::INFO);
    }

}

